<!DOCTYPE html>
<html lang="zh-CN">

	<head>
		<meta charset='utf-8'>
		<link rel="stylesheet" type="text/css" href="../../dist/css/zui.css" />
		<script src="../../dist/lib/jquery/jquery.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../dist/js/zui.js" type="text/javascript" charset="utf-8"></script>
		<link rel="stylesheet" type="text/css" href="../css/common.css" />
		<script src="../js/common.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			includes('BrowserWindow', 'ipc', 'dialog');
		</script>
		<style>
			.container {
				position: absolute;
				top: 30px;
				left: 0;
				right: 0;
				bottom: 0;
			}
		</style>
		<style type="text/css">

		</style>
	</head>

	<body>
		<div class="header ">
			<div class="pull-right " style="width: 100px;">
				<input type="button" class="minbtn" />
				<input type="button" class="maxbtn" />
				<input type="button" class="restorebtn hidden" />
				<input type="button" class="closebtn" />
			</div>
		</div>
		<div class="container ">
			<h1 class="">ipc模块测试窗口<h1>
       
       <div class="row">
		    <div class="col-xs-3">
		      <button class="btn btn-outline-primary btn-block "  onclick="dialog.alert(ipc.sync('message', 1234));" onclick="ipc.exec('message', 1234);">发送普通消息</button>
		    </div>
		    <div class="col-xs-3">
		      <button class="btn btn-outline-primary btn-block "  onclick="dialog.alert(ipc.sync('message', 1234));">发送同步消息</button>
		    </div>
		    <div class="col-xs-3">
		      <button class="btn btn-outline-primary btn-block "  onclick="ipc.async('message', 1234, function(val){dialog.alert(val);});" >发送异步消息</button>
		    </div>
   
			</div>
    </div>
  </body>
  <script type="text/javascript">
  	ipc.on('message', function(){
  	    dialog.alert('收到IPC消息');
  	    return 123456;
  	});
  </script>

</html>